getUnusedAppRestrictionsStatus

open fun getUnusedAppRestrictionsStatus(@NonNull context: Context): ListenableFuture<Integer>(source)

Returns the status of Unused App Restrictions for the current application. In other words, whether the features are available and if so, enabled for the application. The returned value is a ListenableFuture with an Integer corresponding to a value in UnusedAppRestrictionsConstants. The possible values are as follows:

  • ERROR: an error occurred when fetching the availability and status of Unused App Restrictions. Check the logs for the reason (e.g. if the app's target SDK version <30 or the user is in locked device boot mode).
  • FEATURE_NOT_AVAILABLE: there are no available Unused App Restrictions for this app.
  • DISABLED: any available Unused App Restrictions on the device are disabled for this app.
  • API_30_BACKPORT: Unused App Restrictions introduced by Android API 30, and since made available on earlier (API 23-29) devices are enabled for this app: permission auto-reset.
  • API_30: Unused App Restrictions introduced by Android API 30 are enabled for this app: permission auto-reset.
  • API_31: Unused App Restrictions introduced by Android API 31 are enabled for this app: permission auto-reset and app hibernation.
Compatibility behavior: